import * as React from 'react';
import NormalHeader from '../../components/NormalHeader';
import { Redirect } from 'react-router-dom'
import './index.less';
interface Props {
  history: any,
  location: any
}

export default class index extends React.Component<Props> {
  render() {
    let { lesson } = this.props.location.state;
    return this.props.location.state ? (
      <React.Fragment>
        <NormalHeader title='课程详情' history={this.props.history} />
        <div className="lesson-detail">
          <img src={lesson.poster} />
          <p>{lesson.title}</p>
          <p>{lesson.price}</p>
        </div>
      </React.Fragment>
    ) : <Redirect to='/' />
  }
}

